package com.jeff.android.lab.module.anim.loading;

import com.jeff.android.lab.BaseFragment;
import com.jeff.android.lab.R;

import butterknife.OnClick;

/**
 * @author: dingfeng
 * @date: 2020-06-05
 * @since: 1.0.0
 **/
public class LoadingAnimFragment extends BaseFragment {

    private LoadingDialog mLoadingDialog;

    @Override
    protected int getRootLayout() {
        return R.layout.anim_fragment_loading;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    @OnClick(R.id.btn_start)
    void startLoading() {
        if (mLoadingDialog == null)
            mLoadingDialog = new LoadingDialog(mContext);
        if (!mLoadingDialog.isShowing())
            mLoadingDialog.show();
    }

    @OnClick(R.id.btn_stop)
    void stopLoading() {
        if (mLoadingDialog != null && mLoadingDialog.isShowing())
            mLoadingDialog.dismiss();
    }

}
